Top 10k strings from HiSoft C v1.3 +3 (1987)(HiSoft).dsk
in <root> / bin / z80 / software / Sinclair Spectrum Collection TOSEC.exe / Sinclair ZX Spectrum - Utilities & Educational / Sinclair ZX Spectrum - Utilities & Educational - [DSK] (TOSEC-v2007-01-01) /
Back to the directory listing
33 Track-Info 9 /*****************************/ 8 char b[8][8]; 8 calc(0x31); 8 calc(0x01); 8 char *s; 7 calc(0x0f); 6 strconvert("1\0"); 6 inline(0xcd,0x2b,0x2d); 6 calc(0x05); 6 char *s1, *s2; 6 break; 5 calc(0x25); 5 EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 5 /* Standard Function Library */ 5 static int i,j; 4 static a,b,c; 4 putc(i,2); 4 need an lvalue 4 int x,y,m,n; 4 inline(0xef,0x3b,0x38); 4 char b[8][8],p; 4 calc(0x26); 4 calc(0x03); 4 /* Hisoft C */ 4 putchar(8); 3 strconvert("2\0"); 3 k = fillmt(b,p,o,e,t); 3 inline(0xcd,0x14,0x23); 3 inline(0x32,&c); 3 inline(0x2a,&start); 3 cpybrd(a,b); 3 char b[8][8],p,o,e; 3 calc(0x28); 3 bad type combination 3 bad operand type 3 /* A.P.Bermingham 1987 */ 3 static int i; 3 static int i,j,k; 3 static char a[8][8]; 3 static char *p; 3 op=-1; 3 m=1; 3 ++s; 2 while (i--) 2 to flip 'color' and belong to the moving player. After 60 2 the player with the most of his own pieces on the board wins. 2 static start; 2 static start,length; 2 selfplay = ' '; 2 putmov(a,p,i,j); 2 putchar('\n'); 2 putc(y,2); 2 printf("\n"); 2 moves have been played (or if no player has a legal move left), 2 k = abs(rand()) % i; 2 k += chkmov(b,p,i,j); 2 int iscntrl(c) 2 int isascii(c) 2 int inp(port) 2 inline(0xed,0x4b,&c); 2 inline(0xed,0x4b,&b); 2 inline(0xed,0x4b,&a); 2 inline(0xcd,0xf1,0x2b); 2 inline(0x21,&c); 2 inline(0x21,&b,0x4e); 2 inline(0x21,&a,0x46); 2 if (t[i].s != t[0].s || t[i].c != t[0].c) 2 if (b[x][y] != EMPTY) return 0; 2 if (!k) return 0; 2 goto flush; 2 for (i=1; i<k; i++) 2 for (i=0; i<8; i++) for (j=0; j<8; j++) 2 chkmvs(b,p) 2 chkmv1(b,p,x,y,0,1) + chkmv1(b,p,x,y,1,0) + 2 chkmv1(b,p,x,y,0,-1)+ chkmv1(b,p,x,y,-1,0)+ 2 chkmov(b,p,x,y) 2 calc(0x1b); 2 calc(0x06); 2 calc(0x04); 2 c=getchar(); 2 by the moving player's peices -- causing the flanked pieces 2 b[x][y] = p; 2 at least one of the opponent's pieces becomes surrounded 2 analyze(b,p,o,e) 2 _setover(on); 2 HC 2 /* End */ 2 *n = t[k].y; 2 *m = t[k].x; 2 ###~#fo###~#fo#~#fo 2 ###~#fo###~#fo 2 return op; } 2 printf("\n"); 2 _setover(on); 2 while (argc--) 2 while (*s) 2 static struct mt t[64]; 2 static int ok,s,k,l,side,oside; 2 static int c; 2 static int c,dkl; 2 static char *cs; 2 return s1; 2 return s - s1; 2 return c < 0x80 ; 2 putchar('['); } 2 for (i = 0; i < 4; ++i) 2 flash(1); 2 char *s, c; 2 char *a; 2 char *a, *b, *c; 2 argv = ¶m_byte_count + argc; 2 argc = param_byte_count/2 - 1; 2 FILE *fp; 2 The playing pieces are '*' and '@'. You may choose to play 2 return op; } 2 0xE1DD, /* pop ix */ 2 0x69ED); /* out (c),l */ 2 0x4BED, ®_bc, /* ld bc,(reg_bc) */ 2 0x2A, ®_hl, /* ld hl,(reg_hl) */ 2 n=1; 2 n=0; 2 n=-1; 2 m=2; 2 --argv; 2 qsort (t, k, 8, cmpmov); 1 } while (ask("Another game? ")=='Y'); 1 { x +=m; y+=n; } 1 x += m; y +=n; 1 written by Bert Halstead 1 while(b[x][y] == 0) { 1 while(1) { 1 while((c=rawin()) 1 while (x>=0 && x<=7 && y>=0 && y<=7 && b[x][y]==p) 1 while (c != '\n' && c != 4) c= getchar(); 1 while (c != '\n' && c != 4) 1 while ((x += m) >= 0 && x<8 && (y += n)>=0 && y<8) { 1 while ((x += m) >= 0 && x < 8 && (y += n) >= 0 && y<8) 1 while ((c = toupper(getchar())) == ' ' || c=='\t'); 1 w+wTrack-Info 1 void srand(n) 1 void qsort(list, num_items, size, cmp_func) 1 void puts(s) 1 void poke(address, value) 1 void long_set(a, n, d) 1 void long_multiply(c, a, b) 1 void long_init(a, n1, n0) 1 void long_copy(c, a) 1 void long_add(c, a, b) 1 void free(block) 1 void fputs(s, fp) 1 vkeep stre 1 use a predeclared structure for parameters 1 unterminated string or character constant on line above 1 unsigned strlen(s) 1 unsigned reg_hl, reg_de, reg_bc; 1 undefined variable(s) 1 undefined variable 1 undefined label: 1 typedef struct _header HEADER, * HEADER_PTR; 1 typedef int FILE; 1 typedef char * __char_ptr; 1 type should be function 1 too much initialisation data 1 to Z will appear at each of your legal move 1 this variable was not in parameter list 1 t[k].y =j; 1 t[k].x =i; 1 t[k].s = s_move(b,p,o,e,i,j); 1 switch(op) { 1 structure cannot contain itself 1 struct mt { 1 struct mt t[64]; 1 struct mt *a, *b; 1 struct _header 1 strconvert(a) 1 strconvert("3\0"); 1 strconvert("10\0"); 1 strconvert(".434294481"); 1 storage class not valid in this context 1 static sp; 1 static int c; 1 static a,b; 1 stack(b,op) 1 ssion too complicated - too many operators 1 sets handicap. n is 1,2,3, or 4. If n is 1 selfplay='G'; 1 screen(x,y) 1 s_move(b,p,o,e,i,j) 1 return notak1(b,p,o,e,x,y,0,1)&& 1 return length; 1 return i-j; 1 return b[x][y]; 1 return (j); 1 return 'H'; 1 return 'G'; 1 return !(c1==o && c2==e || c1==e && c2==o); 1 retu= 'F'); 1 reciprocal(); 1 reciprocal() 1 quit the current game. 1 puts("Do you want to go first? "); 1 putmv1(b,p,x,y,m,n) 1 putmv1(b,p,x,y,i,j); 1 putmov(b,p,x,y) 1 putmov(b,mine,i,j); 1 putmov(b,his,i,j); 1 putchar(b[i][j]); 1 putchar(8); 1 putchar(32); 1 putchar('['); 1 putchar(' '); 1 putc(x,2); 1 putc(23,2); 1 putc(22,2); 1 putc(21,2); 1 putc(20,2); 1 putc(19,2); 1 putc(18,2); 1 prtbrd(b); continue; 1 prtbrd(b); 1 prtbrd(a); 1 prints out the score, and tells who is winning. 1 prints out board again. 1 printf("\n\n"); 1 printf("\nYou go first:\n\n"); 1 printf("\nNote: `*' always goes first...Good luck!!!\n\n"); 1 printf("\nI go first:\n\n"); 1 printf("Move: "); 1 printf("Illegal!\n"); 1 printf("%2d",i+1); 1 printf("%25s\n","A.P.Bermingham 1987\0"); 1 printf("%23s\n\n","RPN Calculator\0"); 1 printf("%1d-%1d",i = cntbrd(b,his), j=cntbrd(b,mine)); 1 printf(" 1 2 3 4 5 6 7 8\n"); 1 printf(!mefirst ? "Forfeit" : " ...Forfeit\n"); 1 printf(!mefirst ? "...Forfeit\n": "Forfeit...\n"); 1 printf(!mefirst ? "...%1d-%1d\n" : "%1d-%1d...\n", 1 printf(!mefirst ? "%1d-%1d" : " ...%1d-%1d\n", 1 printf ("Illegal!\n"); 1 printf ("Huh?? "); 1 printf ("%s ",s); 1 positive, gives n free pieces to the computer. 1 positions, where A is the machine's opinion 1 point(x,y) 1 plot(on,x,y) 1 placing their marker someplace on an 8 by 8 grid, so that 1 pbstack overflow 1 oside |= 1; 1 oside = 0; 1 of an excellant move and Z is a real loser. 1 notake(b,p,o,e,x,y) 1 notak2(b,p,o,e,x,y,m,n) 1 notak1(b,p,o,e,x,y,m,n) 1 notak1(b,p,o,e,x,y,1,1)&& 1 notak1(b,p,o,e,x,y,1,0)&& 1 notak1(b,p,o,e,x,y,1,-1); 1 not in switch 1 not in loop or switch 1 not in loop 1 not a preprocessor command 1 not a defined member of a structure 1 not a defined member of a str reg_bc = port; reg_hl = data; 1 not a defined member of a str 1 no arrays of functions 1 need a type name 1 need a pointer 1 need a constant expression 1 need a : to follow a ? - check bracketting 1 nd in the store */ 1 my_mov(b,p,o,e,m,n) 1 my_mov(b,mine,his,EMPTY,&i,&j); 1 multiple use of identifier 1 multiple default statements 1 modified for BDS C by Leor Zolman 1 missing 'while' 1 missing ')' in function declaration 1 missing ' ' 1 mine = WHITE; his = BLACK; 1 mine = BLACK; his = WHITE; 1 mefirst = !mefirst; 1 meaning 4th row down, 6th position across. 1 main(argc,argv) 1 macro buffer full 1 line(on,dx,dy) 1 length=strlen(a); 1 is over or until you hit a key. 1 inverse(i) 1 int toascii(c) 1 int strspn(s1, s2) 1 int strncmp(s1, s2, n) 1 int strcspn(s1, s2) 1 int strcmp(s, t) 1 int sign(n) 1 int rand() 1 int peek(address) 1 int out(data, port) 1 int min(param_byte_count) auto 1 int max(param_byte_count) auto 1 int isxdigit(c) 1 int ispunct(c) 1 int isprint(c) 1 int isgraph(c) 1 int isalnum(c) 1 int c,d,i,j,k,m,o; 1 int c,d,e,f,i,op; 1 int atoi(s) 1 int abs(n) 1 int *m, *n; 1 int *i, *j; 1 int skipbl() 1 int getmov(i,j) 1 int ask(s) 1 input(a,m) 1 inline(0xef,0xa3,0x38,0x34); 1 inline(0xef,0x3d,0x38); 1 inline(0xed,0x5b,&start); 1 inline(0xed,0x4b,&length); 1 inline(0xed,0x43,&length); 1 inline(0xeb,0xed,0xb0); 1 inline(0xcd,0xe3,0x2d); 1 inline(0xcd,0xce,0x22); 1 inline(0xcd,0xb4,0x33); 1 inline(0xcd,0xb1,0x2a); 1 inline(0xcd,0xad,0x1c); 1 inline(0xcd,0x9b,0x22); 1 inline(0xcd,0x94,0x23); 1 inline(0xcd,0x83,0x25); 1 inline(0xcd,0x4d,0x0d); 1 inline(0xcd,0x38,0x25); 1 inline(0xcd,0x2d,0x23); 1 inline(0x77,0x23,0x73); 1 inline(0x71,0x23,0x70); 1 inline(0x46,0xcd,0x44,0x0e); 1 inline(0x46,0xcd,0x00,0x0e); 1 inline(0x46); 1 inline(0x3e,0x00); 1 inline(0x3a,&c); 1 inline(0x23,0x72,0x23); 1 inline(0x21,&b,0x46); 1 inline(0x21,&b); 1 inline(0x21,&a,0x4e); 1 inline(0x06,0x2e); 1 inline(0x06,0x1d); 1 inline(0x06,0x1c); 1 illegal parameter type 1 if(op>0) { 1 if(op==0) { 1 if(op=='+') 1 if(isalpha(c)==1) { 1 if(c=='\0') 1 if (x>=0 && x<=7 && y>=0 && y<=7) 1 if (x==0 || x==7 || y==0 || y==7) 1 if (x<0 || x>7 || y<0 || y>7) return p; 1 if (side>0) return s; 1 if (side>0) return s+side-7+10*ok; 1 if (side==2 || notake(b,p,o,e,i,j)) ok++; 1 if (selfplay == 'G') { 1 if (s< -oside) s= -oside; 1 if (mefirst) { 1 if (l==0 || l==7) {dkl+=2; oside|=4; } 1 if (k==0 || k==7) { dkl+=2; oside|=4;} 1 if (j==2 || j==5) s++; 1 if (j==1 || j==6) {s--; side++;} 1 if (i>0) printf(" You're winning\n"); 1 if (i>0) printf(" You won by %d\n",i); 1 if (i==4) break; 1 if (i==2 || i==5) s++; 1 if (i==1 || i==6) {s--; side++;} 1 if (i=='Q') continue; 1 if (ff==3 || n>64) return 'D'; 1 if (dkl==5) {dkl = 10; oside |= 16; } 1 if (cntbrd(b,EMPTY)==0) return 'D'; 1 if (cntbrd(b,EMPTY) == 0) return 'D'; 1 if (chkmvs(b,mine)==0) { 1 if (chkmvs(b,his)==0) { 1 if (c>=10) { s -= 4; oside |= 8; } 1 if (c==4) return c; 1 if (c==0) continue; 1 if (c<'1' || c>'8') goto flush; 1 if (c<'1' || c>'4' || skipbl() !='\n') 1 if (b[x][y]==EMPTY) return 0; 1 if (b[x][y]== p ) return k; 1 if (b[x][y] == EMPTY || b[x][y] == p) return; 1 if (*b++ == p) ++j; 1 if ((i != 0 || j!=0)&&chkmv1(b,p,x,y,i,j)>0) 1 if ((c=skipbl()) == '\n') return 'M'; 1 if ((*a).s > (*b).s) return -1; 1 if ((*a).s < (*b).s) return 1; 1 if ((*a).c > (*b).c) return -1; 1 if ((*a).c < (*b).c) return 1; 1 if (!keyhit()) return 'G'; 1 if (!(ff & 1)) prtbrd(b); 1 i= 64; j=0; 1 i = prtscr(b); 1 i = game(b,4,mefirst); 1 handicap = 0; 1 goto needs a label 1 goes first always plays `*'. 1 getchar(); 1 generated code area is full 1 game(b,n,mefirst) 1 from 1 to 8, first digit representing row and second representing 1 fpconvert(a) 1 forfeit the current move. This happens 1 for (k=0; k<8; k++) for(l=0; l<8; l++) 1 for (j=0; j<8; j++) { 1 for (i=0; i<k; i++) 1 for (i=0; i<8; i++) { 1 for (i=0; i<8; i++) for(j=0; j<8; j++) 1 fillmt(b,p,o,e,t) 1 extern unsigned strlen(); 1 extern char *strcat(), *strncat(), *strcpy(), *strncpy(), *strchr(), *strrchr(), 1 expecting a primary here 1 else switch (c = getmov(&i,&j)) { 1 else putchar('\n'); 1 else printf(" A draw\n"); 1 else printf(!mefirst ? "Forfeit" : 1 else if(op==-4) 1 else if(op==-1) 1 else if(op=='~') 1 else if(op=='|') 1 else if(op=='x') 1 else if(op=='t') 1 else if(op=='s') 1 else if(op=='r') 1 else if(op=='o') 1 else if(op=='l') 1 else if(op=='i') 1 else if(op=='g') 1 else if(op=='e') 1 else if(op=='d') 1 else if(op=='c') 1 else if(op=='a') 1 else if(op=='`') 1 else if(op=='^') 1 else if(op=='\\') 1 else if(op=='T') 1 else if(op=='S') 1 else if(op=='M') 1 else if(op=='L') 1 else if(op=='K') 1 else if(op=='J') 1 else if(op=='I') 1 else if(op=='H') 1 else if(op=='C') 1 else if(op=='@') 1 else if(op=='?') { 1 else if(op=='=') { 1 else if(op=='/') 1 else if(op=='-') 1 else if(op=='*') 1 else if(op=='%') 1 else if(op=='$') 1 else if(op=='#') 1 else if(isdigit(c)==0&&j==1) { 1 else if (i<0)printf(" You're losing!\n"); 1 else if (i<0) printf(" You lost by %d\n",-i); 1 else if (!notake(a,o,p,e,k,l)) 1 else for (j=0; i!=0; j++) { 1 either '*'/* input.prog */ 1 either '*' or '@' for the first game; thereafter, you and the 1 each of your possible moves. A letter from A 1 duplicate declaration of structure tag 1 duplicate declaration - type mismatch 1 duplicate declaration - storage class mismatch 1 duplicate declaration 1 draw(on,x,y,d) 1 direct execution not possible when translating 1 define diagnostlist direct error translatinclude data 1 default: if (c<'1' || c>'8') goto flush; 1 d=input(a,m); 1 cscroll(i) 1 cpybrd(a,b) 1 computer will alternate going first for each game. Whoever 1 commands may be typed: 1 column. For example: if playing '*', your first move might be '46', 1 cntbrd(b,p) 1 cmpmTrack-Info 1 clrbrd(b); 1 circle(on,x,y,r) 1 chkmv1(b,p,x,y,m,n) 1 chkmv1(b,p,x,y,1,1) + chkmv1(b,p,x,y,1,-1)+ 1 chkmv1(b,p,x,y,-1,1)+ chkmv1(b,p,x,y,-1,-1); 1 chkmv1(b,p,x, 1 char selfplay; 1 char p,o,e; 1 char mine, his; 1 char b[8][8], p,o,e; 1 char b[8][8], p, o, e; 1 char b/* graphs.lib */ 1 char a[5]; 1 char a[101],b[101]; 1 char *strrchr(s, c) 1 char *strpbrk(s1, s2) 1 char *strncpy(s1, s2, n) 1 char *strncat(s1, s2, n) 1 char *strcpy(dest, source) 1 char *strchr(s, c) 1 char *strcat(base, add) 1 char *sbrk(n) 1 char *malloc(num_bytes) 1 char *gets(s) 1 char *fgets(s, n, fp) 1 char *calloc(n, size) 1 char *b, p; 1 char *a, *b; 1 char **argv; 1 char _rnum[4]; 1 char reg_a; 1 causes computer to print out an analysis of 1 causes computer to play both sides until game 1 case 4: return c; 1 case '\n': printf("Move? "); continue; 1 case 'S': i= prtscr(b); 1 case 'Q': case 4: return c; 1 case 'H': if (n>abs(handicap)+4) 1 case 'H': if ((a=c=skipbl()) == EMPTY) 1 case 'G': my_mov(b,his,mine,EMPTY,&i,&j); 1 case 'G': if ((c = skipbl()) != '\n') 1 case 'F': if (n>abs(handicap)+4) { 1 case 'F': case 'A': 1 case 'B': prtbrd(b); continue; 1 case 'B': case 'S': case 'Q': 1 case 'A': analyze(b,his,mine,EMPTY); 1 cannot use this operator with float arguments 1 cannot open file 1 can only define identifiers as macros 1 can only call functions 1 calculate(op) 1 calc(0x2a); 1 c=chkmov(a,o,k,l); 1 c2 = notak2(b,p,o,e,x,y,-m,-n); 1 c1 = notak2(b,p,o,e,x,y,m,n); 1 c) use of the "qsort" library function 1 c = skipbl(); 1 beep(duration,pitch) 1 bad initializer (needs a '{') 1 bad function return type 1 bad formal parameter list 1 bad declarator 1 bad declaration 1 bad character constant 1 b) arrays as formal parameters 1 automatically if you have no legal moves. 1 a[i]='\0'; 1 a=skipbl(); 1 a) structured, heirarchical function organization 1 _setover(on) 1 _colour(h,i) 1 _beep(DE,HL) 1 \6>++6[+6:"=\> 1 [IJKLMNOPQRST 1 [=>?@ABCDEFGH 1 Y./0123456789 1 Type y to run: 1 This program is a good example of: 1 STDIO LIB 1 STDIO H 1 RPNTEST C 1 RPN C 1 REVERSI C 1 RESTRICTION: use assignment or move() to initialise automatics 1 RESTRICTION: macros may not have parameters 1 RESTRICTION: cannot nest includes 1 RESTRICTION: Floating Point not implemented 1 RESTRICTION : floats not implemented 1 OTHELLO -- The Game of Dramatic Reversals 1 MV - CPC format Disk Image (DU54) 1 MATHS LIB 1 LIMIT: no more memory 1 LIMIT : too much global data 1 LIMIT : too many types 1 LIMIT : too many case statements 1 LIMIT : name table full 1 LIMIT : local symbol table full 1 LIMIT : global symbol table full 1 LIMIT : expression too complicated - too many operators 1 LIMIT : expression too complicated - too many arguments 1 If n is negative, gives YOU the free peices. 1 INPUT C 1 HiSoft C Compiler v1.3 Plus 3 1 HEADER _base, *_allocp; 1 GRAPHS LIB 1 ERROR - 27 - undefined symbol 1 ERROR %d AT LINE %u 1 EMPTY, EMPTY, EMPTY, WHITE, BLACK, EMPTY, EMPTY, EMPTY, 1 EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY}; 1 EMPTY, EMPTY, EMPTY, BLACK, WHITE, EMPTY, EMPTY, EMPTY, 1 Destination of an assignment must be an lvalue 1 DISK 1 CtoD Cassette to Disc transfer 1 Copyright 1 Cannot initialise this (disallowed type) 1 Cannot initialise this (disallowed storage class) 1 CTOD 1 0118 DOS_BYatic int i,k; 1 0115 DOS_WRITE 1 0112 DOS_READ 1 010C DOS_ABANDO 1 0109 DOS_CLOSE 1 0106 DOS_OPEN 1 0103 DOS_VERSIO 1 0&&tolower(b[i-1]) 1 /g}/o#:#w<2#w 1 /*==!=++--&&||<=<<>=>>-> 1 /****** FILE SYSTEM ******/ 1 /*** System Interface ***/ 1 /* who has black (*) and white (@) in current game */ 1 /* true if computer playing with itself */ 1 /* true if computer goes first in current game */ 1 /* now zero fill the store */ 1 /* handicap position table */ 1 /* Spectrum Graphics and 1 /* Some arithmetic functions */ 1 /* Last changed 31 Oct 1985 */ 1 /* Last changed 15 Aug 1985 */ 1 /* Copyright (C) 1985 Hisoft */ 1 /* Copyright (C) 1984 Hisoft */ 1 /* A.P.Bermingam 1987 */ 1 /* Z80 register cache for inline code */ 1 /* Two variadic arithmetic functions (see manual for details) */ 1 /* String Handling Functions */ 1 /* Storage Allocation and Freeing (Heap Management) */ 1 /* Storage Allocation Structure and Variables */ 1 /* Sorting function - a Shell sort */ 1 /* Some Functions for 32 bit integer arithmetic */ 1 /* Pseudo-Random Number Generator */ 1 /* NB - the common ones are built-in for efficiency */ 1 /* Input and Output */ 1 /* Forward declarations for non-int library functions */ 1 /* Format conversion routine - ASCII to binary integer */ 1 /* File system Structure */ 1 /* Character Test and Manipulate Functions */ 1 /* An illustration of how to grub arouTrack-Info 1 /* END OF OTHELLO */ 1 /* maths.lib */ 1 /* version 1.3 */ 1 /* rpn.prog */ 1 /* End Header */ 1 /* HEADER */ 1 /* */ 1 *j = c- '1'; 1 *i = c-'1'; 1 *i = a==EMPTY? -(c-'0') : (c-'0'); 1 *a++ = *b++; 1 **m~#"*mo& 1 ) ? NULL : s); 1 (sy<<8)+sx; 1 $$=? STXW<>RP|^&OQ+-*/%*&-!~VU 1 #include stdio.h 1 #include rpn.c 1 #include input.c 1 #include ?stdio.lib? 1 #include ?maths.asc? 1 #include ?graphs.lib? 1 #include stdio.h 1 #include ?stdio.lib? 1 #define WHITE '@' 1 #define RL_L 0x15CB 1 #define RLA 0x17 1 #define PUSH_IY 0xE5FD 1 #define PUSH_IX 0xE5DD 1 #define PUSH_HL 0xE5 1 #define POP_IY 0xE1FD 1 #define POP_IX 0xE1DD 1 #define LD_L_A 0x6F 1 #define LD_IX_from 0x2ADD 1 #define LD_H_with 0x26 1 #define LD_HL_with 0x21 1 #define LD_HL_into 0x22 1 #define LD_HL_from 0x2A 1 #define LD_DE_with 0x11 1 #define LD_DE_into 0x53ED 1 #define LD_DE_from 0x5BED 1 #define LD_B_with 0x06 1 #define LD_BC_into 0x43ED 1 #define LD_BC_from 0x4BED 1 #define LD_A_with 0x3E 1 #define LD_A_into 0x32 1 #define LD_A_from 0x3A 1 #define JR_Z 0x28 1 #define JR_NC 0x30 1 #define JP_HL 0xE9 1 #define INC_B 0x04 1 #define HEAPSIZE 1000 1 #define EMPTY '-' 1 #define EI 0xFB 1 #define DI 0xF3 1 #define CALL 0xCD 1 #define BLACK '*' 1 #define ADD_HL_DE 0x19 1 #define void int /* for functions which return no value */ 1 #define _SAFETY 50 /* for sbrk() */ 1 #define TRUE 1 1 #define NULL 0 /* for use with pointers */ 1 #define FAST 1 #define FALSE 0 /* for Boolean operations */ 1 #define ERROR -1 1 #define EOF -1 /* end of file value */ 1 ###~#fo#~#fo 1 #"a\"c\"e\* 1 !Track-Info 1 x += m; y+=n; 1 while(c = *s++)putchar(c); 1 unsigned duration,pitch; 1 strconvert(b); 1 static sx,sy,de,bc; 1 static int c; 1 static ft; 1 static de,hl; 1 return i; 1 return _colour(17,i); 1 return _colour(16,i); 1 return -2; 1 reciprocal(); 1 putchar('\n'); 1 putc(i,2); 1 putc(h,2); 1 push(a); } 1 printf("\nsyntax error:bad input"); 1 printf("\025%c",on?0:1); 1 print(); } 1 pitch=pitch/10; 1 inline(0xed,0x5b,&de, 1 inline(0xdd,0xe5, 1 inline(0xdd,0x46,4, 1 inline(0xcd,25236); 1 if(j==2) { 1 if(c==12&&i>0) { 1 if(c=='+') 1 if (x<0 || x>7 || y<0 || y>7 || b[x][y]==e) 1 if (i<0 | i>7) return -1; 1 if (dy<0) 1 if (dx<0) 1 if ( ! pitch) 1 i += i>0 ? -1 : 1; 1 handicap += i>0 ? 1 : -1; 1 ft=duration*pitch/10; 1 for(i=0;i 1 for HiSoft C 1 flash(0); 1 else k++; 1 else if(j==4) { 1 else if(j==3) { 1 else if(i<m) { 1 else if(c==12&&i==0); 1 else if(c=='|') 1 else if(c=='^') 1 else if(c=='\\') 1 else if(c=='?') 1 else if(c=='=') 1 else if(c=='/') 1 else if(c=='-') 1 else if(c=='*') 1 else if(c=='%') 1 case '~': 1 case '|': 1 case 'x': 1 case 't': 1 case 's': 1 case 'r': 1 case 'o': 1 case 'l': 1 case 'i': 1 case 'g': 1 case 'e': 1 case 'd': 1 case 'c': 1 case 'a': 1 case '`': 1 case '^': 1 case '\\': 1 case 'T': 1 case 'S': 1 case 'M': 1 case 'L': 1 case 'K': 1 case 'J': 1 case 'I': 1 case 'H': 1 case 'C': 1 case '@': 1 case '?': 1 case '=': 1 case '/': 1 case '-': 1 case '+': 1 case '*': 1 case '%': 1 case '$': 1 case '#': 1 bc=(dy<<8)+dx; 1 b[h[j][0]][h[j][1]]= i>0?BLACK:WHITE; 1 _exit(n); 1 _beep(ft,cast(unsigned)43750/pitch-30); 1 HiSoft 1987 1 Finished OK 1 Disk error! 1 : does not follow a ? properly 1 1984-7 HiSoft 1 (cntbrd(b,EMPTY)==60 && mine == BLACK) goto Istart; 1 " ...Forfeit\n"); 1 !"#$%&'() 1 while (n-- && *s2) *s++ = *s2++; 1 while (n) 1 while (isspace(*s)) ++s; 1 while (isdigit(c = *s++)) value = 10 * value + c - '0'; 1 while (c = *s++) putc(c, fp); 1 while (TRUE); 1 while (TRUE) 1 while (--n > 0 && (c = getc(fp)) != EOF) 1 while (*t++); 1 while (*s1) 1 while (*s1 == *s2) 1 while (*s) ++s; 1 while (*s == *t) 1 while (*result++ = *source++) ; 1 while (*dest++ = *add++); 1 while (*dest) ++dest; 1 while ((c = getchar()) 1 value = 0; 1 unsigned n; 1 unsigned n1,n0; 1 unsigned n, d; 1 unsigned _size; 1 unsigned n, size; 1 struct _header * _ptr; 1 static unsigned u, i; 1 static unsigned gap, byte_gap, i; 1 static unsigned nbytes; 1 static int n; 1 static int k; 1 static int i,k; 1 static int i,k,c; 1 static int i, j; 1 static int handicap; 1 static int h[4][2] = {0, 0, 1 static int ff; 1 static int c1,c2; 1 static int c, value, sign; 1 static int argc, *argv, min; 1 static int argc, *argv, max; 1 static int c; 1 static char x[4], product[4]; 1 static char mefirst; 1 static char k[4]; 1 static char empty_board[8][8] = { 1 static char c; 1 static char b[8][8]; 1 static char a,c; 1 static char *t; 1 static char *s; 1 static char *s, c; 1 static char *result; 1 static char *p, 1 static char *dest; 1 static HEADER *p, *q; 1 static HEADER *p, *q; 1 sp-=n; } 1 sign = 1; 1 s = NULL; 1 return s; 1 return ptr; 1 return p; 1 return p-s-1; 1 return min; 1 return max; 1 return dest; 1 return a; 1 return NULL; 1 return *s1 - *s2; 1 return *s - *t; 1 return ((c == EOF && cs == sTrack-Info 1 return sign * value; 1 return n<0 ? -n : n ; 1 return n ? 1 return isprint(c) & ! isalnum(c); 1 return isdigit(c) | (c >= 'A' & c <= 'F'); 1 return isalpha(c) | isdigit(c) ; 1 return c >= ' ' & c < '\177' ; 1 return c > ' ' & c < '\177' ; 1 return c < ' ' | c == '\177' ; 1 return c < ' ' | c = 1 return c & 0x7F; 1 return base; 1 return * cast(__char_ptr) address; 1 return ((_rnum[3] << 8) + _rnum[2]) & 0x7FFF; 1 result = dest; 1 reg_bc = port; reg_hl = data; 1 putchar(c); 1 putchar(32); 1 ptr = malloc(length = n * size); 1 printf("\nstack error:too few arguments"); } 1 printf("Illegal!\n"); 1 p=heap_ptr; 1 p = q->_ptr; 1 p = cast(HEADER_PTR) block - 1; 1 op='\\'; 1 nbytes = (num_bytes + (sizeof(HEADER) - 1)) / sizeof(HEADER) + 1; 1 move(ptr+1, ptr, length-1); 1 move(c, a, 4); 1 move(b, empty_board, 8*8); 1 min and max are in "stdio.h" 1 min = 32767; 1 max = -32767; 1 long_set(product, 0,0); 1 long_multiply(_rnum, _rnum, k); 1 long_init(k, 0x41c6,0x4e6d); 1 long_init(k, 0,0x3039); 1 long_init(_rnum, 0,n); 1 long_copy(c, product); 1 long_add(_rnum, _rnum, k); 1 int (*cmp_func)(); 1 int num_items, size; 1 int n; 1 inline(0xe1,0xe1,0xe1, 1 inline(0xCD,0xD6B); 1 if(c==205) 1 if(c=='t'&&d=='e'&&e=='n'&&f=='x') 1 if(c=='s'&&d=='i'&&e=='n') 1 if(c=='l'&&d=='n') 1 if(c=='+'||c=='-') { 1 if(c==' '||c=='\0') { 1 if (q + q->_size == p) 1 if (p + p->_size == q->_ptr) 1 if (heap_ptr+n > heap+HEAPSIZE) return ERROR; 1 if (d < 3) a[d+1] = n >> 8; 1 if ((q = _allocp) == NULL) /* no free list */ 1 if (( c = skipbl()) != '\n') goto flush; 1 if (!n) return 0; 1 if ( ! ptr) return NULL; 1 if ( ! num_bytes) return NULL; 1 if (*s == '-') { ++s; sign = -1; } 1 heap_ptr += n; 1 for(ft=0;ft<duration;++ft) 1 for (q = _allocp; !(p > q && p < q->_ptr); q = q->_ptr) 1 for (i=0; i<4; ++i) a[i] = 0; 1 for (gap = num_items >> 1; gap > 0; gap >>= 1) 1 else if(tolower(c)=='e') { 1 else if(c==226) 1 else if(c==195) 1 else if(c=='t'&&d=='a'&&e=='n') 1 else if(c=='s'&&d=='q'&&e=='r') 1 else if(c=='s'&&d=='q'&&e=='d') 1 else if(c=='s'&&d=='g'&&e=='n') 1 else if(c=='p'&&d=='i') 1 else if(c=='l'&&d=='o'&&e=='g') 1 else if(c=='i'&&d=='n'&&e=='t') 1 else if(c=='h'&&d=='t'&&e=='n') 1 else if(c=='h'&&d=='s'&&e=='n') 1 else if(c=='h'&&d=='c'&&e=='s') 1 else if(c=='h'&&d=='a'&&e=='t') 1 else if(c=='h'&&d=='a'&&e=='s') 1 else if(c=='h'&&d=='a'&&e=='c') 1 else if(c=='e'&&d=='x') 1 else if(c=='e'&&d=='x'&&e=='p') 1 else if(c=='e'&&d=='x'&&e=='i'&&f=='t') 1 else if(c=='d'&&d=='u'&&e=='p') 1 else if(c=='d'&&d=='e'&&e=='l') 1 else if(c=='c'&&d=='r'&&e=='t') 1 else if(c=='c'&&d=='o'&&e=='s') 1 else if(c=='c'&&d=='l'&&e=='s') 1 else if(c=='a'&&d=='t'&&e=='n') 1 else if(c=='a'&&d=='s'&&e=='n') 1 else if(c=='a'&&d=='c'&&e=='s') 1 else if(c=='a'&&d=='b'&&e=='s') 1 else if(c=='.') { 1 else if (*s == '+') ++s; 1 else q->_ptr = p; 1 else p->_ptr = q->_ptr; 1 do ; while (*p++); 1 do if (*t == c) s = t; 1 dest = base; 1 continue; 1 char *sbrk(); 1 char *s, *t; 1 char *list; 1 char *dest, *source; 1 char *block; 1 char *base, *add; 1 char *a, *c; 1 calculate(op); 1 c = toupper(c); 1 c = *s2; 1 because they are variadic 1 a[t[i].x][t[i].y] = ((c = 'F' - t[i].s) <= 'Z')?c:'Z'; 1 a[i++]=c; 1 a[d] = n & 0xff; 1 a[3] = n1 >> 8; 1 a[2] = n1 & 0xff; 1 a[1] = n0 >> 8; 1 a[0] = n0 & 0xff; 1 a[--i]='\0'; 1 _allocp = q; 1 Hisoft C */ 1 FAST char length; 1 FAST char *ptr; 1 *s = NULL; 1 *ptr = 0; 1 *cs = 0; 1 *cs = '\0'; 1 * cast(__char_ptr) address = value; 1 sy= 0xFF; 1 sx= 0xFF; 1 return op; } 1 pper(getchar())) == ' ' || c=='\t'); 1 op='~'; 1 op='x'; 1 op='t'; 1 op='s'; 1 op='r'; 1 op='o'; 1 op='l'; 1 op='i'; 1 op='g'; 1 op='e'; 1 op='d'; 1 op='c'; 1 op='a'; 1 op='`'; 1 op='T'; 1 op='S'; 1 op='M'; 1 op='L'; 1 op='K'; 1 op='J'; 1 op='I'; 1 op='H'; 1 op='C'; 1 op='@'; 1 op='$'; 1 op='#'; 1 if(e>1||i==0) { 1 if(d>1) { 1 if (t[k].c = chkmov(b,p,i,j)) { 1 for(pitch=4630;++pitch;); 1 dy= -dy; 1 dx= -dx; 1 b[j++]=c; 1 You enter a move as a two digit number, each digit being 1 Sound Functions */ 1 Object of the game is for two players to alternate 1 As an alternative to entering a move, one of the following 1 0x2b,0xc3,0x55,0); 1 ((c==-1 && cs==s) ? 1 } /* end while TRUE */ 1 stack(b,o); 1 o=word(b,j); 1 j=0; } 1 if(o==-3) 1 if (q >= q->_ptr && (p > q || p < q->_ptr)) break; 1 if ((*cs++ = c) == '\n') break; 1 heap[HEAPSIZE], 1 for (j = i; j >= 0; --j) 1 b[j]='\0'; 1 NULL : s ); 1 Adapted from "Learning to Program in C" by Thomas Plum. 1 0xE5, /* push hl */ 1 0xE1, /* pop hl */ 1 0xE1, 1 0xC9); /* ret */ 1 0xC1, /* pop bc */ 1 0x68ED, /* in l,(c) */ 1 0x26, 0, /* ld h,0 */ 1 *heap_ptr=heap; 1 ( n<0 ? -1 : 1 ) : 0 ; 1 !=EOF && c!='\n') 1 return 0; 1 u >>= 8; 1 u += *a++ + *b++; 1 q->_size += p->_size; 1 q->_ptr = p->_ptr; 1 q = p; 1 p->_size += q->_ptr->_size; 1 p->_ptr = q->_ptr->_ptr; 1 p = p->_ptr; 1 m=0; 1 if (strchr(s2, *s1)) return s1; 1 if (strchr(s2, *s)) break; 1 if (p->_size >= nbytes) /* big enough */ 1 if (p == _allocp) /* wrapped around free list */ 1 if (*s == c) return s; 1 if (*argv > max) max = *argv; 1 if (*argv < min) min = *argv; 1 if (! *s) return 0; 1 if ( ! strchr(s2, *s)) break; 1 if ( ! --n) break; 1 if ( ! *s1) return 0; 1 if ( ! *s) return NULL; 1 for (i = gap; i < num_items; ++i) 1 byte_gap = gap * size; 1 _base._size = 0; 1 _base._ptr = _allocp = q = &_base; 1 Please start tape 1 --n; 1 ++s; ++t; 1 ++s1; ++s2; 1 ++s1; 1 *s++ = ( c ? ( c = *s2++ ) : 0 ) ; 1 *cs++ = c; 1 *c++ = u & 0xff; 1 E RPW !"#$%&'()*+,-./DDDDDDDDDD:;<=>?@LLLLLLLLLLLLLLLLLLLLLLLLLL[\]^L`LLLLLLLLLLLLLLLLLLLLLLLLLL{|}~ 1 while(1) switch (c=skipbl()) { 1 static char c; 1 side = 0; /*DJH*/ 1 printf("\n\nWelcome to the Hisoft C OTHELLO program!\n"); 1 modified for Hisoft C by Dave Howorth 1 mefirst = (toupper(rawin()) != 'Y'); 1 long_set(x, a[i-j] * b[j], i); 1 long_add(product, product, x); 1 if (side == 2) return 5; /*DJH*/ 1 if (side == 2) return -19; /*DJH*/ 1 if (j==1 || j==6) side++; /*DJH*/ 1 if (j==0 || j==7) side++; 1 if (i==1 || i==6) side++; /*DJH*/ 1 if (i==0 || i==7) side++; 1 for (p = list + i * size - byte_gap; p >= list; p -= byte_gap) 1 for (i= -1; i<=1; i++) for (j= -1; j<=1; j++) { 1 0xed,0x5b,&de, 1 0xed,0x4bTrack-Info 1 0xdd,0xe1); 1 0xdd,0x4e,6, 1 0xcd,0x3b5, 1 0xcd,0x24ba); 1 0xcd,0x22e5); 1 0x2a,&hl, 1 - remove an & from call to qsort (its not right on an array) 1 - make variables static to save hundreds of bytes 1 - correct some function type errors 1 - change to unix-style rand() function 1 } 1 { 1 return cast(__char_ptr) (p+1); 1 p->_size = nbytes; 1 p = _allocp; 1 if (p->_size == nbytes) q->_ptr = p->_ptr; /* just right size */ 1 if ((p = cast(HEADER_PTR) sbrk(nbytes * sizeof(HEADER))) == ERROR) 1 free(p+1); 1 else 1 _allocp = q; 1 } 1 { /* split block and allocate tail */ 1 swap(p, p + byte_gap, size); 1 return NULL; 1 if ((*cmp_func)(p, p + byte_gap) <= 0) break; 1 *strpbrk(), *calloc(), *malloc(), *sbrk(), *fgets(), *gets(); 1 p->_size -= nbytes; 1 p->_size = nbytes; 1 p += p->_size; 1 ifTrack-Info 1 case 'M': if (chkmov(b,his,i,j)>0) { 1 7, 7, 1 7, 0}; 1 0, 7,